UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'an/YwTBR7P9c+9myWrNSQJfYPSijSjzssooArsj8w84=' 
WHERE 
  key_id = '7b5aba13ad3bd86094d8709f60d2ce4b738d95082ff6f80afd5df21cd52d014b' 
  AND (
    token = 'an/YwTBR7P9c+9myWrNSQJfYPSijSjzssooArsj8w84=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029