UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RSqQ+SsHMO3TBKubNOtrDaUnGY3tl96gCYq2ewC/Dbw=' 
WHERE 
  key_id = '89e51c9515790397d3e1b55246aee96fe97949b1cd26ea709c6f3f9c61366672' 
  AND (
    token = 'RSqQ+SsHMO3TBKubNOtrDaUnGY3tl96gCYq2ewC/Dbw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023