UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P3p2mVKV2yE/Lhrq6otsI+Po+PYCr4Z4wsEcif7wAhE=' 
WHERE 
  key_id = '91b061326eeffe3f1df033256fd97faa4a97e2e0c2f532b663008d2066410d97' 
  AND (
    token = 'P3p2mVKV2yE/Lhrq6otsI+Po+PYCr4Z4wsEcif7wAhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075