UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WIDS9yHQzvc5Ke3ZmisKCSaEJ6aqIfi5mFOMFPMEwDk='
WHERE
key_id = '862e25a3d3dba8a1435763cad9ca56f47f572208521bdb016649a6c9d09b5bc9'
AND (
token = 'WIDS9yHQzvc5Ke3ZmisKCSaEJ6aqIfi5mFOMFPMEwDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)