UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L/GFOBptX82dYwqrhEeqRSLC7lTHRaIOmdOOqo4FiUM=' 
WHERE 
  key_id = '63bfa1f334c820d30ab5e81a32d69dc471c06e4c47853e1b3999c62768314528' 
  AND (
    token = 'L/GFOBptX82dYwqrhEeqRSLC7lTHRaIOmdOOqo4FiUM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038