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