UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qusbZysqYtz4zb5C6SmhbA/F1G7PmhzbqqJmQi++8/I='
WHERE
key_id = '063ad66a14ceb6769a841e009b9868240f712b133d61f3ab6b543131ccacaac1'
AND (
token = 'qusbZysqYtz4zb5C6SmhbA/F1G7PmhzbqqJmQi++8/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)