UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M3yc8PmoD731WHDpAp6J0BrcmtFRJJQeBfm1zAD0wmA='
WHERE
key_id = '78d3bffd096e787fd6427ca8f2df4401eef0295bf0ea5aa1422d6db1b3ee5100'
AND (
token = 'M3yc8PmoD731WHDpAp6J0BrcmtFRJJQeBfm1zAD0wmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)