UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wsa5wDO5XRMddfiGh4lGzuN/ISKza+rBByZT2NR0wXg=' 
WHERE 
  key_id = '232b98d075141584460d6ff59426bde86119c9915350bd5ba552496c55aa4cb6' 
  AND (
    token = 'wsa5wDO5XRMddfiGh4lGzuN/ISKza+rBByZT2NR0wXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047