UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IxKuEHV0UWjN5IgEjl54JP+tP/9d1gb9+yFAiL3yCpg=' 
WHERE 
  key_id = '3fb16b19a8c80fa5ba028b66ed948a51519c99e08cb9d88747a7565388306117' 
  AND (
    token = 'IxKuEHV0UWjN5IgEjl54JP+tP/9d1gb9+yFAiL3yCpg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039