UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q4X7ZcUCOc/HvJo+/m58qTfncIcmvHOd+/Jm5F/xKMI='
WHERE
key_id = 'abb91f206dd8a801a9e5493a5c0718da6d3b81a9b9b7518b2cd2501b37a8a485'
AND (
token = 'Q4X7ZcUCOc/HvJo+/m58qTfncIcmvHOd+/Jm5F/xKMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)