UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iCAeKyu+xQ6Z9TpJB2SnDmzOtdvspbQ6yItksAwkfrA=' 
WHERE 
  key_id = '83f319bd02c9086d77bb119ee1bde1fb0118d07bd3beb0eea6cc706107554935' 
  AND (
    token = 'iCAeKyu+xQ6Z9TpJB2SnDmzOtdvspbQ6yItksAwkfrA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024