UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mRHsHp5WJp7h97lnVnuBcGUxljrP5PgbY2Sv9k0Mmzg=' 
WHERE 
  key_id = '61b21da28918fba50deba9e7a7b1eb0b52651b4f32028686434f2583e61126dd' 
  AND (
    token = 'mRHsHp5WJp7h97lnVnuBcGUxljrP5PgbY2Sv9k0Mmzg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026