UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ae/DPfW47ZNI7FqBcaqR3JsF3TBvcE8Q4qry7kSgTpI='
WHERE
key_id = '93d53166a7326cb81b1bac80c380a41808503fb0fa3363828e7d28c7ae196e3a'
AND (
token = 'Ae/DPfW47ZNI7FqBcaqR3JsF3TBvcE8Q4qry7kSgTpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)