UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rI6jb4bxYgw7wcuhbs3HIrzWdpQQ5ewcVHihkjn/eoo='
WHERE
key_id = 'c206eed21685e1e7c7c6d84841fbf8443c06ae75a460476451f119c75163f053'
AND (
token = 'rI6jb4bxYgw7wcuhbs3HIrzWdpQQ5ewcVHihkjn/eoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)