UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'knr/FBa/3LnftdEiypg9IyYXR3oG+WCzTgX0eqBrRBg=' 
WHERE 
  key_id = 'abdb26c3392bc717f4eb651ad5785daf1cf3cb2dfb528ad0f7cbc459da6090bf' 
  AND (
    token = 'knr/FBa/3LnftdEiypg9IyYXR3oG+WCzTgX0eqBrRBg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041