UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q4Wp1zeSJujF2KwnZuHScMNosLejb0bH+9secxW2kpI='
WHERE
key_id = '780203016dcdf2ecbd5cd37e95e95657e0ed4529f63dd656de19ec98199c61f9'
AND (
token = 'q4Wp1zeSJujF2KwnZuHScMNosLejb0bH+9secxW2kpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)