UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eNoZ/oaEgzVxBu9tts9iFFs1GdgpsttaHmF9Mrk4o1w='
WHERE
key_id = '323f62666ef4509a05fc1beebaa32b9edc183116255e88b00d727938706753dc'
AND (
token = 'eNoZ/oaEgzVxBu9tts9iFFs1GdgpsttaHmF9Mrk4o1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)