UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ty6ilz8DYy5plfLdR9MsQ5q0LiyzsG+hOivklPD/qhY='
WHERE
key_id = '11cfd9fcdecf9119a1b6ed811806d7e97d28143a7af4a0a26480290619936239'
AND (
token = 'Ty6ilz8DYy5plfLdR9MsQ5q0LiyzsG+hOivklPD/qhY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)