UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R2HFUR6vK7vYXQgOf2kCF09drkNQluy0WikCMdwjxmI='
WHERE
key_id = '1a92895431a5c023a1bd9f15c92a5399abe9678fd1ebb3a509e1e17c5429d416'
AND (
token = 'R2HFUR6vK7vYXQgOf2kCF09drkNQluy0WikCMdwjxmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)