UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rZstFtMwI1Zd3/7XDBDYuvhG9dGw/VeSSFymKKGzqlY='
WHERE
key_id = 'bcd1da17aa01d7db1786f89d2163169ca67c535638bf9e873a9a82fdf729545d'
AND (
token = 'rZstFtMwI1Zd3/7XDBDYuvhG9dGw/VeSSFymKKGzqlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)