UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oJi1GPXFnh0byyk3UdPBQOaQBfbp+ZUQgTJa0qEhhZs='
WHERE
key_id = '0c9039b6d8d00466170a7ed85759bbce342f1fedc9d057c91f4008630b5cf4f2'
AND (
token = 'oJi1GPXFnh0byyk3UdPBQOaQBfbp+ZUQgTJa0qEhhZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)