UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IHvZDpOxavNPTVYVpeeme0KWtBZUXTHH10rnSNTKqos='
WHERE
key_id = '086a345e60bf82684a729b244bebe39a0659671c3a88644a577b627902c64298'
AND (
token = 'IHvZDpOxavNPTVYVpeeme0KWtBZUXTHH10rnSNTKqos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)