UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6UP9VJ/vmme6FOmQNqQ9tojufiNHic4UytBVYAdXp7U='
WHERE
key_id = '0ef9cd0ba1dc7893cb76d0e858b1991d1d37ac8e911571862c237361f0ac54d5'
AND (
token = '6UP9VJ/vmme6FOmQNqQ9tojufiNHic4UytBVYAdXp7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)