UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7BsrKxFlgllyZvx3gnINhYjjt6fwksmMSaXXyYBxB3s='
WHERE
key_id = '280e1f1e63b435c837d35c7344a0fdd5433507413399628197aec91721d5ad34'
AND (
token = '7BsrKxFlgllyZvx3gnINhYjjt6fwksmMSaXXyYBxB3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)