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