UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wp45RccHDoH1RP4fr14r9kwUVpTQBBTKGSNqEBTnndI='
WHERE
key_id = '3dbb05d6691328eea134c1c735ead0997062ff8faa0f60a865e6b66aa8dd735b'
AND (
token = 'Wp45RccHDoH1RP4fr14r9kwUVpTQBBTKGSNqEBTnndI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)